// components/component-a/component-a.js
Component({
  /**
   * 组件的属性列表 props
   */
  properties: {
    name: String,
    age: {
      type: Number,
      value: 100 // 默认值
    },
    address: {
      type: Object,
      value: {
        province: '广东',
        city: '深圳'
      }
    }
  },

  lifetimes: {
    created() {
      console.log('---created---')
    },
    attached() {
      console.log('---attached---')
    },
    ready() {
      console.log('---ready---',this)
    },
    detached() {
      console.log('---detached---')
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    sentValueToParent() {
      this.triggerEvent('myevent',[{
        name: '文清',
        nickname: '卧龙先生'
      },{
        name: '阿奕',
        nickname: '凤雏'
      }])
    }
  }
})
